import { Router } from 'express';
import { DictDataController } from '../controllers/dictDataController';
import { authMiddleware } from '../middlewares/authMiddleware';
export default (): Router => {
  const router = Router();
  const dictDataController = new DictDataController();

  // 公开路由：注册和登录

  // // 受保护的路由：需要登录才能访问
  router.post('/add', authMiddleware, dictDataController.add);
  router.delete('/delete', authMiddleware, dictDataController.delete);
  router.get('/findByDictId', authMiddleware, dictDataController.findByDictId);
  router.put('/update', authMiddleware, dictDataController.update);
  router.post('/findByCodes', authMiddleware, dictDataController.findByCodes);
  return router;
};